class Behavior {
    constructor(priority = 0) {
        this.priority = priority; // 优先级
    }
    
    execute() {
        throw new Error("Execute method should be implemented by subclass.");
    }
}


class BehaviorManager {
    static executeBehaviors(component) {
        // 按优先级依次执行行为
        component.behaviors.forEach(behavior => behavior.execute());
    }
}


export { Behavior , BehaviorManager };